<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>Demo</title>
    <link rel="stylesheet" href="../output/css/all.css"/>
    <link href="http://pic.ofcard.com/themes/admin/plugins/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"
          type="text/css"/>
</head>
<body style="background-color: #fff !important;" ng-app="admin">
<ui-container style="display: none" controller="CC">

    <div class="row">
        <div class="col-md-2">
            <ui-tree-region expand="1" on-click="treeOneClick"></ui-tree-region>
        </div>

        <div class="col-md-2">
            <ui-menu url="/menu"></ui-menu>
        </div>


        <div class="col-md-8">
            <ui-search-form>
                <ui-search-input class="input-medium" label="测试" name="test"></ui-search-input>
                <ui-search-select name="test2">
                    <option value="aaa">创建人</option>
                    <option value="bbbb">沟通人</option>
                </ui-search-select>
                <ui-search-input-select>
                    <option value="aaa">联系方式</option>
                    <option value="bbbb">客户姓名</option>
                </ui-search-input-select>
                <ui-search-multi-select tip="xxxxx">
                    <option value="aaa">联系方式</option>
                    <option value="bbbb">客户姓名</option>
                    <option value="ccc">联系方式</option>
                    <option value="ddd">客户姓名</option>
                </ui-search-multi-select>
                <ui-search-date class="input-medium" label="日期" name="test3"></ui-search-date>
                <ui-search-region mode="c" label="区域" name="asdasd22"></ui-search-region>
                <ui-search-user-select class="input-medium" label="用户"></ui-search-user-select>
                <ui-search-date-range label="注册时间"></ui-search-date-range>
            </ui-search-form>

            <ui-tool-bar-table blank="6" add del editable>
            </ui-tool-bar-table>

            <ui-table url="/test" edit-url="/test">
                <ui-table-check-column name="a"></ui-table-check-column>
                <ui-table-column head="checkbox" name="a" editable="region"></ui-table-column>
                <ui-table-progress-column head="progress" name="a"></ui-table-progress-column>
                <ui-table-image-column head="image" name="ww"></ui-table-image-column>
                <ui-table-date-column head="date" name="e" ></ui-table-date-column>
                <ui-table-state-column hred="state" name="f" default="0" >
                    <span class='label label-sm label-default' state="0" style='background-color:red !important'>0</span>
                    <span class='label label-sm label-default' state="1" style='background-color:green !important'>1</span>
                </ui-table-state-column>
                <ui-table-operation-column head="opertion">
                    <a class="btn btn-sm default" href="javascript:;" ng-click="managePotential()"><iclass="fa fa-cogs"></i></a>
                    <a class="btn btn-sm default" href="javascript:;" ng-click="assignPotential()"><i class="fa fa-hand-o-right"></i></a>
                    <a class="btn btn-sm default" href="javascript:;" ng-click="editContact()"><i class="fa fa-comments-o"></i></a>
                    <a class="btn btn-sm default" href="javascript:;" ng-click="assignClaim()"><i class=" fa fa-chain"></i></a>
                    <a class="btn btn-sm default " href="javascript:;" ng-click="assignRelease()"><i class=" fa fa-chain-broken"></i></a>
                </ui-table-operation-column>
            </ui-table>
        </div>
    </div>


</ui-container>
</body>
<script src="../output/js/lib.js"></script>
<script src="http://pic.ofcard.com/themes/admin/plugins/zTree/jquery.ztree.core-3.5.min.js"
        type="text/javascript"></script>
<script src="http://pic.ofcard.com/themes/admin/plugins/zTree/jquery.ztree.excheck-3.5.js"
        type="text/javascript"></script>
<script src="http://pic.ofcard.com/themes/admin/plugins/zTree/jquery.ztree.exedit-3.5.js"
        type="text/javascript"></script>
<script src="../output/js/all.js"></script>

<script>
    $.mockjax({
        url: '/menu',
        response: function () {
            this.responseText = {
                data: [
                    {
                        title: '首页',
                        icon: 'icon-home',
                        children: [
                            {
                                title: 'A',
                                icon: 'icon-home'
                            },
                            {
                                title: 'A',
                                icon: 'icon-home'
                            }
                        ]
                    }
                ],
                result: 1
            }
        }
    });

    var i = 0;
    var a = 0;
    $.mockjax({
        url: '/test',
        response: function () {
            var aa = [],
                    m = 5;
            for (; i < m; i++) {
                aa.push({
                    a: i,
                    b: Math.random(),
                    c: Math.random(),
                    d: Math.random(),
                    e: '2014-11-1' + i + ' 11:11:11'
                })
            }
            this.responseText = {
                data: {
                    aaData: aa,
                    iTotalDisplayRecords: 1000,
                    iTotalRecords: 1000
                },
                result: 1
            }
        }
    });
</script>
<script src="../output/assets/js/angular.1.3.8.min.js"></script>
<script src="../output/assets/js/all.js"></script>
<script>
    function CC($scope, uiDialog) {
        $scope.managePotential = function () {
            var dialog = uiDialog.load('modal.html', $scope, 'DDCtrl');
        }
    }


    angular.module('admin').controller('DemoCtrl', function ($scope, uiDialog) {
        $scope.managePotential = function () {
            var dialog = uiDialog.load('modal.html', 'DDCtrl', $scope);
            setTimeout(function () {
                alert('我要删除了')
                dialog.close();
            }, 2000)
        }
        $scope.treeOneClick = function (treeNode, index) {
            alert(1);
        }
        $scope.treeTwoClick = function (treeNode, index) {
            alert(2);
        }

        console.info($scope);
    })
</script>
</html>
